F.module("/static/common/ui/submit/submit.js",
function(d, b) {
    var c = d("/static/common/lib/tangram/base/base.js");
    var a = d("/static/common/ui/dialog/dialog.js");
    var e = d("/static/common/ui/ut/ut.js");
    Submit = c.lang.createClass(function(g) {
        var j = this;
        var f = c.lang.guid();
        var i = {
            name: f + "_FORM_NAME",
            id: f + "_FORM_ID",
            action: "/submit/",
            method: "post"
        };
        function k(q, p, o) {
            var n = c.dom.create("form", o);
            for (var m in p) {
                var l = c.dom.create("input", {
                    type: "hidden",
                    name: m,
                    value: p[m]
                });
                n.appendChild(l)
            }
            if (c.g(q)) {
                c.g(q).appendChild(n)
            }
        }
        var h = {
            url: "/submit/ajax/",
            params: {},
            hasJump: false,
            reloadOnError: true,
            beforeJump: function(l) {},
            beforeError: function(l) {},
            jumpSubmit: function(m, l) {
                k("body", m, c.object.extend(i, l || {}));
                c.g(i.id).submit()
            },
            errorDeal: function(m) {
                var l = new a({
                    type: "alert",
                    width: "300",
                    height: "100",
                    titleText: "知道提示",
                    contentText: m.info
                });
                l.render();
                l.open();
                if (h.reloadOnError) {
                    setTimeout(function() {
                        window.location.reload(true)
                    },
                    3000)
                }
            }
        };
        c.object.extend(h, g);
        h.params.utdata = e.report()["c"];
        c.ajax.request(h.url, {
            method: "post",
            data: c.url.jsonToQuery(h.params),
            onsuccess: function(p, n) {
                var m = c.json.parse(n);
                var l = m.errorNo;
                var o = m.data;
                if (l == 0) {
                    h.beforeJump(o);
                    if (h.hasJump) {
                        h.jumpSubmit(o)
                    }
                } else {
                    h.beforeError(o);
                    h.errorDeal(o);
                    j.fire("onerror")
                }
            },
            onfailure: function() {
                var l = new a({
                    type: "alert",
                    width: "300",
                    height: "100",
                    titleText: "知道提示",
                    contentText: "网络异常啦：（请重新提交"
                });
                l.render();
                l.open()
            }
        })
    });
    b = Submit;
    return b
},
["/static/common/lib/tangram/base/base.js", "/static/common/ui/dialog/dialog.js", "/static/common/ui/ut/ut.js"]);